<?php
/**
 * class App_Controller_Review
 *
 * @author kim
 */
class App_Controller_Review extends Zend_Controller_Action
{
    /**
     * default action
     */
    public function indexAction()
    {
        $this->_forward('list');
    }

    /**
     * list recent reviews
     */
    public function listAction()
    {
        $review = new App_Model_Review();
        $this->view->reviews = $review->getReviews();
    }

    /**
     * list reviews by user id
     *
     * @todo use current user's profile from session if "user_id = current_user['id']"
     */
    public function listByUserAction()
    {
        $userId = $this->getRequest()->getParam('user_id');
        if ($userId) {
            $user = new App_Model_User();
            $this->view->profile = $user->getProfile($userId);

            $review = new App_Model_Review();
            $this->view->reviews = $review->getReviewsByUserId($userId);
        }
    }

    /**
     * list reviewers
     *
     */
    public function listReviewersAction()
    {
        $user = new App_Model_User();
        $this->view->reviewers = $user->getReviewers();
    }


}
